<%@ page language="java" contentType="application/xls; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@page import="com.ereport.entity.DailyActivity"%>
<%@page import="java.util.List"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.text.DateFormat"%>
<%@page import="java.util.Date"%>


<%
List<DailyActivity> mnlist=(List<DailyActivity>)session.getAttribute("mnlist");
        System.out.println("mnlist in jsp "+mnlist);
        if(mnlist!=null){
        	if(mnlist.size()!=0){
        		System.out.println("mnlist size is "+mnlist.size());
        %>
        
          <table width="98%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td align="left" valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                  <tr>
                    <td>
                    <div id="demo3">
                    <table width="100%" border="1" align="center" cellpadding="3" cellspacing="1" bgcolor="#787878" class="tablebox" id="mnTable">
                        <thead>
                        <tr style="background:url('<%=application.getContextPath() %>/images/hed-bg-block-2.jpg'); background-repeat:repeat-x; background-position:left top">
                          
                          <td width="144" align="center" valign="middle" class="hed"><strong>Company</strong></td>
                          <td width="91" align="center" valign="middle" class="hed"><strong>Division/Group</strong></td>
                          <td width="56" align="center" valign="middle" class="hed"><strong>Contact Person </strong></td>
                          
                          <td width="135" align="center" valign="middle" class="hed"><strong>Objective </strong></td>
                          <td width="110" align="center" valign="middle" class="hed"><strong>Cutomer Feed Back</strong></td>
                          <td width="110" align="center" valign="middle" class="hed"><strong>Action To Be Taken</strong></td>
                          <td width="68" align="center" valign="middle" class="hed"><strong>Date </strong></td>
                          <td width="48" align="center" valign="middle" class="hed"><strong>Kms</strong></td>
                          
                        </tr>
                        </thead>
                        <tbody>
                        <%
                        int c3=0;
                        int kmsTotal3=0;
                  for(int n=0;n<mnlist.size();n++){
                  %>
                        <tr>
                          
                          <td bgcolor="#ffffff" title="<%=mnlist.get(n).getOrganisation()%>" align="center">
                          
                          <%=mnlist.get(n).getOrganisation()%>
                          
                          </td>
                          <td bgcolor="#ffffff" title="<%=mnlist.get(n).getDivision()%>" align="center">
                          <%= mnlist.get(n).getDivision()%>
                          </td>
                          <td bgcolor="#ffffff" title="<%=mnlist.get(n).getContPerson()%>" align="center">
                          <%= mnlist.get(n).getContPerson()%>
                          </td>
                          
                          <td  bgcolor="#ffffff" title="<%=mnlist.get(n).getVistObj()%>" align="center">
                            <%=mnlist.get(n).getVistObj()%>
                          </td>
                          <td  bgcolor="#ffffff" title="<%= mnlist.get(n).getVistOc()%>" align="center">
                            <%= mnlist.get(n).getVistOc()%>
                          </td>
                          <td align="center" bgcolor="#ffffff"><%= mnlist.get(n).getNextstep()%></td>
                            <%
                          String dmdate="";
                         Date dat=mnlist.get(n).getEdate();
                          DateFormat dfmt=new SimpleDateFormat("dd-MM-yyyy");
                          	dmdate=dfmt.format(dat.getTime());
                          %>
                          <td  bgcolor="#ffffff" title="<%=dmdate%>" align="center">
                   				<%=dmdate%>
                          </td>
                          <td  bgcolor="#ffffff" title="<%=mnlist.get(n).getKms()%>" align="center">
                   				<%= mnlist.get(n).getKms()%>
                          </td>
                           
                        </tr>
                 
                        <%
                        c3=n;
                        int k3=mnlist.get(n).getKms();
                        kmsTotal3=kmsTotal3+k3;
                  }
				%>
				</tbody>
                    </table>
                    </div>
                    </td>
                  </tr>
                 
              </table></td>
            </tr>
            <tr>
           		<td align="left" >&nbsp;</td>
           			
           	</tr>
             <tr>
           			<td align="left" >
						<table width="98%" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td align="left" width="120" class="hed-blc">No.of Customers:&nbsp;<%=c3+1%></td>
								<td align="left"> </td>
								<td align="right">
								
								<input type="button" class="button-black-right" value="Export to Excel" onclick="expExcel()"/>
								
								 </td>
							</tr>
							 <tr>
           						<td align="left" class="hed-blc">Total Kms:&nbsp;<%=kmsTotal3 %></td>
           						<td align="left"> </td>
           						<td align="left">&nbsp; </td>
           		  			</tr>
						</table>
					</td>
           			
           	</tr>
           	<tr>
           		<td align="left" >&nbsp;</td>
           			
           	</tr>  
                  
          </table>
        
        <%
        
        }else {
        %>
         <table width="98%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td align="center" valign="top">
        <p class="box-border1 hed-blc" style="font-size: 13px" > No Records Found</p>
        </td>
        </tr>
        </table>
      <%
        }
        	session.setAttribute("mnlist",null);
        }
		%>
